<?php
/**
 *      [迷你云] (C)2009-2012 南京恒为网络科技.
 *   软件仅供研究与学习使用，如需商用，请访问www.miniyun.cn获得授权
 * 
 */
?>
<?php


class MConst
{
    
    const USER_METAS_LENGTH  = 2;
    
    const TOKEN_LENGTH  = 32;
    const SECRET_LENGTH = 32;
    

        const NOT_ENOUGH_SPACE                        = 8;
        const USER_BE_FORBIDDEN                       = 9;
        const USER_EXPIRED                            = 10;
        const DONT_EXIST_PARENT                       = 11;
        const DONT_EXIST_DEVICE                       = 14;
        const EXIST_CHILD                             = 16;

        const DONT_EXIST_BLOCK_SIGNATURE              = 18;
    
        const FINISH_BLOCK_FAILURE                    = 21;
        const WRONG_STRING_LENGTH                     = 23;
        const NOT_SHARE_DIRECTORY                     = 24;
        const NO_USER_IN_SHARE_DIRECTORY              = 25;
        const UPDATE_SHARE_DIR_SIZE_FAILER            = 26;
        const BLOCK_LOST                              = 28;
        const DONT_EXIST_REMOTE_DATA                  = 29;
        const BLOCKS_NOT_MATCH_VERSION                = 30;
        const CREATE_EVENT_FAILURE                    = 31;
        const JSON_EXCEPTION                          = 32;
        const DONT_EXIST_ROOT_OBJECT                  = 33;
        const EXCEPTION                               = 34;
        const DONT_HAVE_PERMISSION                    = 35;
        const RENAME_FAILURE                          = 37;
        const OBJECT_TYPE_DONT_MEET_REQUIREMENT       = 40;
        const DIRECTORY_IS_BEING_USED                 = 41;
        const DIRECTORY_ISNOT_EMPTY                   = 42;
        const SESSION_EXCEPTION                       = 43;
        const USER_DONT_START_SERVICE                 = 44;
        const DONT_EXIST_VERSION                      = 45;

        const MODIFY_FILE_CONFLICT                    = 61;

                
            const ERROR_UPLOADIND_ID                        = 102;
        const ERROR_NO_PARENT_UUID                      = -1;
        const ERROR_SUCCESS                             = 0;
            const ERROR_VALID_OBJECT_UPLOADED               = 2;
        const ERROR_NULL_PARAM                          = 5;
        const ERROR_USER_DONT_EXIST                     = 7;
        const ERROR_DONT_EXIST_OBJECT                   = 13;
        const ERROR_EXIST_BLOCK_SIGNATURE               = 17;
        const ERROR_DONT_EXIST_OBJECT_SIGNATURE         = 20;
        const ERROR_DONT_EXIST_BLOCK                    = 22;
        const ERROR_WRONG_ACTION                        = 27;
        const ERROR_EXCEPTION                           = 34;
        const ERROR_ILLEGAL_REQUEST                     = 39;
                    const ERROR_RENAME_OBJECT                       = 49;
        const ERROR_PARENT_UUID_IS_NULL                 = 53;
        const ERROR_INVALID_OBJECT_TYPE                 = 100;
    
                const ERROR_TO_BE_DONE                          = 1000;
    
                const UPLOAD_FILE_FAILS                       = 7100;
    const DOWNLOAD_FILE_FAILS                     = 7200; 
    
                    const ROOT_UUID                             = "-1";
    const ROOT_UUID_INT                         = -1;
    const ROOT_PATH                             = "\\";
    
                const OBJECT_TYPE_DIRECTORY                 = 1;
    const OBJECT_TYPE_FILE                      = 0;

                const LEN_OBJECT_UUID                       = 32;
                const LEN_EVENT_UUID                        = 46;
    
    
                const OPERATION_UP_UUIDS                    = 0;
                const OPERATION_UP_CREATE                   = 1;
    const OPERATION_CHILDS                      = 2;
                const OPERATION_UP_SIGNATURES               = 3;
                    const OPERATION_UP_SINGLE                   = 4;
                const OPERATION_UP_DELETES                  = 5;
                const OPERATION_UP_LISTS                    = 6;
                const OPERATION_TOTAL_ACTIONS               = 7;
                const OPERATION_EVENTS                      = 8;

     
                const DB_STATUS_NOT_EXIST                  = 0;
                const DB_STATUS_EXIST_BLOCK                = 1;
                const DB_STATUS_EXIST_UPLOADING            = 2;
    
    const ACCESS_KEY                            = "Fw5GmdDY8h3JmBnN";
    const EXPIRATION_DATE                       = "expiration_date";
    const ACCESS_KEY_ID                         = "\${access.key.id}";
    
    
    const SUCCESS_COPY                          = 'success';
    const LOGIN_FAIL_COPY                       = 'Parse login request failed';
    const USER_NOT_EXIST_COPY                   = 'User Dont Exist';
    const ASSEMBLY_PROTOC_EXCEPTION_COPY        = 'Assembly Protocol Exception';
    
    const PARAMS_ERROR                          = "Bad input parameter.";
    const FILE_NOT_EXIST                        = "File don't exist.";
    const UPLOAD_OVER                           = "Upload file success.";
    const INVLID_REQUEST                        = "Bad Request.";
    const UPLOAD_FILE_ERROR                     = "Upload file error.";
    const NOT_FOUND                             = "NOT FOUND.";
    const INTERNAL_SERVER_ERROR                 = "Internal Server Error";
    const REQUEST_MOTHOD_ERROR                  = "Request method not expected (generally should be GET or POST).";
    const PATH_ERROR                            = "Request path is null.";
    const NOT_ACCEPTABLE                        = "Not acceptable";
    const CONTINUE_OPTION                       = "Continue";
    
    const PHONE     = 1;
    const WEB       = 2;
    const PCCLIENT  = 3;
    
                const EVENT_UUID_ZERO           = 0;
    
    const CREATE_DIRECTORY       = 0;      const DELETE                 = 1;      const MOVE                   = 2;      const CREATE_FILE            = 3;      const MODIFY_FILE            = 4;      
    
    
    const RESTORE               = 6;     
    
    const CURRENT_SIZE = "current_size";
    const MIME_TYPE    = "mime_type";
    const VERSION      = "version";
    
    
    
    const HTTP_CODE_200 = "200";
    const HTTP_CODE_304 = "304";
    const HTTP_CODE_303 = "303";            const HTTP_CODE_400 = "400";
    const HTTP_CODE_401 = "401";
    const HTTP_CODE_403 = "403";            const HTTP_CODE_404 = "404";
    const HTTP_CODE_405 = "405";
    const HTTP_CODE_406 = "406";
    const HTTP_CODE_407 = "407";            const HTTP_CODE_411 = "411";
    const HTTP_CODE_415 = "415";
    const HTTP_CODE_500 = "500";
    const HTTP_CODE_503 = "503";
    const HTTP_CODE_507 = "507";
    
    const API = "/api/";
     
    const VERSION_1 = "/1/";
    
    const MAX_FILES_COUNT = 10000;
    
    const CONFLICT_FILE_NAME = "(conflict copy)";
    
    const DEFAULT_DOWNLOAD_MIME_TYPE = "application/force-download";
    const DEFAULT_FILE_MIME_TYPE     = "application/octet-stream";
    
    const MAX_IMAGE_SIZE = 20971520; }
?>